from .log import logger
from .main import Hive
from .task import Task, LoopTask, OnceTask
from .cmd import run_command

CODE_MAP = {
    "SC": {"code": "sc", "exchange": "INE"},
    "BU": {"code": "bu", "exchange": "SHFE"},
    "AL": {"code": "al", "exchange": "SHFE"},
    "AU": {"code": "au", "exchange": "SHFE"},
    "CU": {"code": "cu", "exchange": "SHFE"},
    "HC": {"code": "hc", "exchange": "SHFE"},
    "NI": {"code": "ni", "exchange": "SHFE"},
    "EB": {"code": "eb", "exchange": "DCE"},
    "EG": {"code": "eg", "exchange": "DCE"},
    "JD": {"code": "jd", "exchange": "DCE"},
    "LH": {"code": "lh", "exchange": "DCE"},
    "PG": {"code": "pg", "exchange": "DCE"},
    "ZN": {"code": "zn", "exchange": "SHFE"},
    "LU": {"code": "lu", "exchange": "INE"},
    "FU": {"code": "fu", "exchange": "SHFE"},
    "SS": {"code": "ss", "exchange": "SHFE"},
    "RB": {"code": "rb", "exchange": "SHFE"},
    "SN": {"code": "sn", "exchange": "SHFE"},
    "RU": {"code": "ru", "exchange": "SHFE"},
    "WR": {"code": "wr", "exchange": "SHFE"},
    "AG": {"code": "ag", "exchange": "SHFE"},
    "PB": {"code": "pb", "exchange": "SHFE"},
    "IH": {"code": "IH", "exchange": "CFFEX"},
    "IF": {"code": "IF", "exchange": "CFFEX"},
    "A": {"code": "a", "exchange": "DCE"},
    "B": {"code": "b", "exchange": "DCE"},
    "BB": {"code": "bb", "exchange": "DCE"},
    "C": {"code": "c", "exchange": "DCE"},
    "CS": {"code": "cs", "exchange": "DCE"},
    "FB": {"code": "fb", "exchange": "DCE"},
    "I": {"code": "i", "exchange": "DCE"},
    "J": {"code": "j", "exchange": "DCE"},
    "JM": {"code": "jm", "exchange": "DCE"},
    "L": {"code": "l", "exchange": "DCE"},
    "M": {"code": "m", "exchange": "DCE"},
    "P": {"code": "p", "exchange": "DCE"},
    "PP": {"code": "pp", "exchange": "DCE"},
    "RR": {"code": "rr", "exchange": "DCE"},
    "V": {"code": "v", "exchange": "DCE"},
    "Y": {"code": "y", "exchange": "DCE"},
    "CF": {"code": "CF", "exchange": "CZCE"},
    "CJ": {"code": "CJ", "exchange": "CZCE"},
    "CY": {"code": "CY", "exchange": "CZCE"},
    "FG": {"code": "FG", "exchange": "CZCE"},
    "JR": {"code": "JR", "exchange": "CZCE"},
    "LR": {"code": "LR", "exchange": "CZCE"},
    "MA": {"code": "MA", "exchange": "CZCE"},
    "OI": {"code": "OI", "exchange": "CZCE"},
    "PF": {"code": "PF", "exchange": "CZCE"},
    "PM": {"code": "PM", "exchange": "CZCE"},
    "RI": {"code": "RI", "exchange": "CZCE"},
    "RM": {"code": "RM", "exchange": "CZCE"},
    "RS": {"code": "RS", "exchange": "CZCE"},
    "SA": {"code": "SA", "exchange": "CZCE"},
    "SF": {"code": "SF", "exchange": "CZCE"},
    "SM": {"code": "SM", "exchange": "CZCE"},
    "SR": {"code": "SR", "exchange": "CZCE"},
    "TA": {"code": "TA", "exchange": "CZCE"},
    "UR": {"code": "UR", "exchange": "CZCE"},
    "WH": {"code": "WH", "exchange": "CZCE"},
    "NR": {"code": "nr", "exchange": "INE"},
    "BC": {"code": "bc", "exchange": "INE"},
    "SP": {"code": "sp", "exchange": "SHFE"},
    "AP": {"code": "AP", "exchange": "CZCE"},
    "ZC": {"code": "ZC", "exchange": "CZCE"},
    "PK": {"code": "PK", "exchange": "CZCE"},
    "T": {"code": "T", "exchange": "CFFEX"},
    "TF": {"code": "TF", "exchange": "CFFEX"},
    "TS": {"code": "TS", "exchange": "CFFEX"},
    "IC": {"code": "IC", "exchange": "CFFEX"},
}
